from math import sqrt

j=2
count=0
while j<=100:
    i=2
    k=int(sqrt(j))
    while i<=k:
        if j%i==0:
            break
        i+=1
    if i>k:
        count+=1
        if count%5==0:
            print(j,end='\n')
        else:
            print(j,end=' ')
    j+=1